Skip to content

Add an optional scoped mimalloc allocator for shared builds - #258

Merged
zayenz merged 10 commits into
mainfrom
feature/mimalloc
Oct 20, 2026
Merged

zayenz merged 10 commits into
mainfrom
feature/mimalloc

Conversation

@zayenz

@zayenz zayenz commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Add the opt-in CMake option GECODE_ENABLE_MIMALLOC for Gecode heap and Space storage. It embeds mimalloc 3.5.3 privately in shared gecodesupport, without changing application malloc or new. Installed consumers need no mimalloc package. The system allocator is the default.

The option requires GECODE_BUILD_STATIC=OFF to avoid symbol conflicts with a host allocator. Shared Gecode can coexist with libminizinc's mimalloc. Static Gecode uses system allocation, which MiniZinc's process-wide replacement can also cover. Rebuild consumers when changing backends. Custom allocators, sanitizer builds, and peak-heap accounting are unsupported with this option.

CI adds one Linux shared-library job for mimalloc, covering private symbols, installed-package allocation across libraries and threads, and coexistence with a host allocator. Local checks also passed on macOS.

@zayenz
zayenz marked this pull request as ready for review October 20, 2026 06:47
@zayenz zayenz changed the title Add an optional scoped mimalloc allocator Add an optional scoped mimalloc allocator for shared builds Oct 20, 2026
@zayenz
zayenz merged commit e2b9105 into main Oct 20, 2026
15 checks passed
@zayenz
zayenz deleted the feature/mimalloc branch October 20, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant